from sklearn.preprocessing import StandardScaler
from sklearn.datasets import load_boston
import numpy as np

x, y = load_boston(True)

sclr = StandardScaler()
x1 = sclr.fit_transform(x)
y1 = sclr.fit_transform(y.reshape(-1, 1)).ravel()

mu = x.mean(axis=0)
sigma = x.std(axis=0)
x2 = (x - mu) / sigma
mu = y.mean(axis=0)
sigma = y.std(axis=0)
y2 = (y - mu) / sigma

print(np.allclose(x1, x2))
print(np.allclose(y1, y2))
